\( \require{newcommand} \)
\( \newcommand{\diff}[2]{\frac{d{#1}}{d{#2}}} \)


====== A Trojan horse approach to medical intervention strategies ======

I recently read an interesting review paper [Brown2009] that explores the possibility of fighting a bacterial infection with [[wp>Evolutionary medicine | Darwinian medicine]] through the introduction of a "cheater" strain of bacteria into a wild population.  I extended the analytic model in the paper to an agent-based model with explicit spatial structure. 

{{ https://raw.githubusercontent.com/rikblok/NetLogo-models/master/brown2009-web.nlogo }}

<WRAP right round tip 25%>
===== Tips =====
  - For a long run you may want to increase the speed slider (reduces frame rate)\\ {{:science:popmod:brown2009:faster.gif?nolink|}}\\ and/or increase __err-tolerance__ (reduces __accuracy__).
  - The default parameters often give interesting cyclical patterns.((The simulation's default parameters violate the [[#Quasi-steady-state approximation]] so the equations in [Brown2009] are not applicable.))  [[#Table 1]] has parameter values that can be used to compare against [Brown2009].
</WRAP>


====== Theory ======

This simulation incorporates three ideas from Section 2 of [Brown2009]:
  * (a) A cheat that does not produce exoproducts (public goods),
  * (b) Trojan horse cheats, and 
  * (d) Bacteriocinogen cheat invasion.

Instead of approximating spatial structure with the relatedness factor $r$ in 2<nowiki>(c)</nowiki> "Trojan horse cheat in a spatially structured host" I just explicitly put the bacteria in space -- they diffuse in a two-dimensional continuum with periodic boundaries.

===== Numeric model =====

Combining (a), (b), and (d) gives the following dynamical equations for the rate of change of the wild ($W$) and cheat ($C$) strain densities:
\begin{equation}
\begin{array}{rcrccccl}
  \diff{W}{t} 
  & = & W ( & \overbrace{1}^{\text{growth}} & \overbrace{- N}^{\text{competition}} & \overbrace{- x}^{\text{costs}} & \overbrace{+ b W / N}^{\text{public good}} & \overbrace{- a C / N}^{\text{toxication}} & \overbrace{- e C / N}^{\text{bacteriocide}} )\\
  \diff{C}{t} 
  & = & C ( & 1 & - N & - q & + b W / N & - a C / N )
\end{array}
\label{eq:qssa}
\end{equation}
where
  * $N = W + C$ is the total bacterial density,
  * $x$ is the cost of producing the public good,
  * $q$ is the direct growth cost of the cheat (if any),
  * $b$ is the benefit of the public good,
  * $a$ is the strength of the antibacterial toxin, and
  * $e$ is the efficacy of the bacteriocinogen.

These two equations combine Eqs. (2.1)-(2.5) from [Brown2009] -- the effects can be explored separately in the simulation by moving sliders of other parameters to zero.  The numeric dynamics are displayed as faint curves in the "dynamics" and "phase" graphs.  They are included to validate and compare with the agent-based model.

<WRAP center round box 80%>
^  Figure  ^  $W(0)$(($W(0)=$initial-W-density))  ^  $C(0)$(($C(0)=$initial-C-density))  ^  $x$(($x=$x-wild-cost))  ^  $q$(($q=$q-cheater-cost))  ^  $b$(($b=$b-shared-benefit))  ^  $a$(($a=$a-toxin-production))  ^  $e$(($e=$e-bacteriocinogen))  ^  well-mixed(($r=0$ is well-mixed.))  ^
|  4(a)  | 1.1  | 0.001  | 0.1  | 0     | 0.2  | 0     | 0    |  Yes  |
|  4(b)  | 1.1  | 0.001  | 0.1  | 0     | 0.2  | 0     | 0    |  No   |
|  4<nowiki>(c)</nowiki>  | 1.1  | 0.001  | 0.1  | 0.01  | 0.2  | 0.5   | 0    |  Yes  |
|  4(d)  | 1.1  | 0.001  | 0.1  | 0.01  | 0.2  | 0.5   | 0    |  No   |
|  4(e)  | 1.1  | 0.001  | 0.1  | 0.01  | 0.2  | -0.3  | 0    |  Yes  |
|  4(f)  | 1.1  | 0.001  | 0.1  | 0.01  | 0.2  | -0.3  | 0    |  No   |
|  5(a)  | 1.1  | 0.001  | 0.1  | 0.15  | 0.2  | 0     | 0.5  |  Yes   |
|  5(b)  | 1.1  | 0.13   | 0.1  | 0.15  | 0.2  | 0     | 0.5  |  Yes   |
|  5<nowiki>(c)</nowiki>  | 1.1  | 0.001  | 0.1  | 0.05  | 0.2  | 0     | 0.5  |  Yes   |
|  5(d)  | 1.1  | 0.13   | 0.1  | 0.05  | 0.2  | 0     | 0.5  |  Yes   |
<BOOKMARK:table_1>Table 1: Parameter values used in the figures of [Brown2009], for comparison.  The well-mixed cases usually agree with my model dynamics, except for stochastic noise due to demographics (eg. extinction of one type).
</WRAP>

===== Agent-based model =====

The numeric model can be derived as a non-spatial limiting case of an agent-based model.  In this model we explicitly represent each individual "agent" in the system instead of treating them as identical and just tracking aggregate population densities.  A convenient approach is to borrow [[wp>reaction kinetics]] from physical chemistry to describe allowed interactions in our model.  

To capture the numeric model we require five types/species((Note the overlapping notation: the symbols for individual agents are re-used to represent the densities of said types.  Hopefully, the context (eg. density in a rate equation) is sufficient to prevent confusion.)):
  * $W$ is a wild-type bacterium,
  * $C$ is a cheat bacterium,
  * $F$ is a parcel of food,
  * $T$ is a parcel of toxin, and
  * $B$ is a parcel of bacteriocinogen.

We simply allow these agents to interact stochastically at given rates according to the following reactions:
\begin{equation}
\begin{array}{rclrcll}
  N & \xrightarrow{1} & 2 N & & & & \text{(growth)} \\
  W + N & \xrightarrow{1} & N, & C + N & \xrightarrow{1} & N & \text{(competition)} \\
  W & \xrightarrow{x} & \emptyset, & C & \xrightarrow{q} & \emptyset & \text{(costs)} \\
  W & \xrightarrow{b} & W + F, & N + F & \xrightarrow{\beta} & 2 N & \text{(public good)} \\
  C & \xrightarrow{a} & C + T, & N + T & \xrightarrow{\delta} & \emptyset & \text{(toxication)} \\
  C & \xrightarrow{e} & C + B, & C + B & \xrightarrow{\gamma} & C & \text{(bacteriocide)} \\
    & & & W + B & \xrightarrow{\gamma} & \emptyset
\end{array}
\label{eq:agent}
\end{equation}
where $\emptyset$ indicates an absence of products and $N$ is shorthand for either $W$ or $C$.

A moment's review should satisfy the reader that these reactions are reasonable prescriptions.  For example, $W \xrightarrow{b} W + F$ indicates that each wild-type bacterium produces a food parcel at an average rate of $b$ per unit time.  A bacterium that encounters a food parcel consumes it at rate $\beta$ and benefits by reproducing, $N + F \xrightarrow{\beta} 2 N$.

In the agent-based approach we model these processes explicitly and track all of the agents as they are produced, changed, or removed from the system.  To connect with the numeric model we apply the [[wp>law of mass action]] to compute the dynamics of a large, well-mixed population following the above reactions:
\begin{equation}
\begin{array}{rcrccccl}
  \diff{W}{t} 
  & = & W ( & \overbrace{1}^{\text{growth}} & \overbrace{- N}^{\text{competition}} & \overbrace{- x}^{\text{costs}} & \overbrace{+ \beta F}^{\text{public good}} & \overbrace{- \delta T}^{\text{toxication}} & \overbrace{- \gamma B}^{\text{bacteriocide}} )\\
  \diff{C}{t} & = & C ( & 1 & - N & - q & + \beta F & - \delta T )\\
  \diff{F}{t} & = &     &   &     &     & b W - \beta F N\\
  \diff{T}{t} & = &     &   &     &     &           & a C - \delta T N\\
  \diff{B}{t} & = &     &   &     &     &           &              & e C - \gamma B N.
\end{array}
\label{eq:full}
\end{equation}

===== Quasi-steady-state approximation =====

Eq. ($\ref{eq:full}$) looks much more complicated than ($\ref{eq:qssa}$) we're trying to relate it to.  But we can reduce the system if we assume that the densities $F$, $T$, and $B$ are //fast// variables -- that they respond quickly to perturbations and quickly converge to equilibrium.  If we assume that they converge so quickly that the slow variables ($W$ and $C$) don't change appreciably while the fast ones equilibrate then we can approximate the fast variables as always being in equilibrium -- the [[wp>Michaelis%E2%80%93Menten_kinetics#Quasi-steady-state_approximation | quasi-steady-state approximation]] (QSSA):
\[
\begin{array}{rcl}
  F & = & b W / \beta N\\
  C & = & a C / \delta N\\
  B & = & e C / \gamma N.
\end{array}
\]
Then Eq. ($\ref{eq:full}$) reduces to exactly ($\ref{eq:qssa}$) and the agent-based model in Eq. ($\ref{eq:agent}$) is an extension of [Brown2009] to finite populations.  Unfortunately, finding the conditions to satisfy QSSA is not trivial [Segel1989].  Nevertheless, it should be satisfied if all of the rate constants $\beta$, $\delta$, and $\gamma$ are large.  In the simulation I set them all to the same large constant so we may expect differences between the agent-based and numeric models result from other causes, such as spatial structure.

===== Spatial structure =====

Brown et al. [Brown2009] create a structured population in Section 2<nowiki>(c)</nowiki> through preferential interactions of the bacteria with kin, mimicking spatial segregation.  Implementing it as an agent-based model  in [NetLogo] allows me to explicitly include space: agents move continuously in a two-dimensional plane with periodic boundary conditions.  Reactions are localized to patches on a square grid.  In the limit of large population size and infinitesimal patch size mass action swamps stochastic effects and the model should become equivalent to a [[wp>reaction-diffusion system]].

I arbitrarily chose to allow only the bacteria (wild and cheater types) to move.  Byproducts (food, toxin, & bacteriocinogen) are stationary after being created.  Some other options would be to allow the byproducts to move (for example, as if they were diffusing via [[wp>Brownian motion]]) or for both bacteria and byproducts to move (possibly at different rates).

Unlike other events, which are treated as probabilistic [[wp>stochastic processes]], every moving agent moves in every time increment according to a [[wp>random walk]], with a jump size is governed by the diffusion constant.  The effects of spatial structure can be minimized by mixing((Enable the __well-mixed__ switch to rapidly stir the system.)).  Only bacteria move so there may still be some spatial effects from the stationary byproducts but the dynamics should be more similar to the numeric ([[wp>mean field]]) approximation.

====== More information ======

{{https://raw.githubusercontent.com/rikblok/NetLogo-models/master/brown2009-web.nlogo?do=mdinfo}}


====== References =======

<html>
<script src="http://bibbase.org/show?bib=https%3A%2F%2Fapi.zotero.org%2Fusers%2F906284%2Fitems%3FitemKey%3DFBQ5QXEH,TFNHSS7V,HFKP83P7,RC75EVDC%26format%3Dbibtex&jsonp=1&authorFirst=1&fullnames=1"></script>
</html>

====== Share =======

Like this page?  Share it!

~~lsb~~

====== Comments ======

~~DISQUS~~
